<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateChengYuTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cheng_yu', function (Blueprint $table) {
            $table->increments('id');
            $table->string('cheng_yu')->nullable()->comment('成语');
            $table->string('bu_shou')->nullable()->comment('首字母部首');
            $table->string('head')->nullable()->comment('词头');
            $table->string('pin_yin')->nullable()->comment('拼音');
            $table->text('cheng_yu_j_s')->nullable()->comment('成语解释');
            $table->text('from_')->nullable()->comment('成语出处');
            $table->text('example')->nullable()->comment('举例');
            $table->text('yu_fa')->nullable()->comment('语法');
            $table->text('ci_yu_j_s')->nullable()->comment('词语解释');
            $table->text('yin_zheng_j_s')->nullable()->comment('引证解释');
            $table->text('tong_yi')->nullable()->comment('同义词');
            $table->text('fan_yi')->nullable()->comment('反义词');
            $table->index('cheng_yu');
            $table->index('pin_yin');
            $table->engine = 'InnoDB';
            $table->charset = 'utf8mb4';
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('cheng_yu');
    }
}
